package com.ruoyi.project.system.service.impl;

import java.util.List;

import com.ruoyi.project.system.domain.SysMobileUser;
import com.ruoyi.project.system.domain.SysOption;
import com.ruoyi.project.system.mapper.SysMobileUserMapper;
import com.ruoyi.project.system.mapper.SysOptionMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.system.mapper.SysRecordMapper;
import com.ruoyi.project.system.domain.SysRecord;
import com.ruoyi.project.system.service.ISysRecordService;

/**
 * 【请填写功能名称】Service业务层处理
 *
 * @author theme
 * @date 2020-05-27
 */
@Service
public class SysRecordServiceImpl implements ISysRecordService {
    @Autowired
    private SysRecordMapper sysRecordMapper;
    @Autowired
    private SysMobileUserMapper sysMobileUserMapper;
    @Autowired
    private SysOptionMapper sysOptionMapper;

    /**
     * 查询【请填写功能名称】
     *
     * @param mobileUserId 【请填写功能名称】ID
     * @return 【请填写功能名称】
     */

    @Override
    public SysRecord selectSysRecordById(Long mobileUserId) {
        return sysRecordMapper.selectSysRecordById(mobileUserId);
    }

    @Override
    public List<SysRecord> selectSysRecordByMobileUserId(Long mobileUserId) {
        return sysRecordMapper.selectSysRecordByMobileUserId(mobileUserId);
    }

    /**
     * 查询【请填写功能名称】列表
     *
     * @param sysRecord 【请填写功能名称】
     * @return 【请填写功能名称】
     */
    @Override
    public List<SysRecord> selectSysRecordList(SysRecord sysRecord) {
        List<SysRecord> sysRecords = sysRecordMapper.selectSysRecordList(sysRecord);
/*        for (int i = 0; i < sysRecords.size(); i++) {
            Long mobileUserId = sysRecords.get(i).getMobileUserId();
            SysMobileUser sysMobileUser = sysMobileUserMapper.selectSysMobileUserById(mobileUserId);
            Long optionId = sysRecords.get(i).getOptionId();
            SysOption sysOption = sysOptionMapper.selectSysOptionById(optionId);

        }*/
        return sysRecords;
    }

    /**
     * 新增【请填写功能名称】
     *
     * @param sysRecord 【请填写功能名称】
     * @return 结果
     */
    @Override
    public int insertSysRecord(SysRecord sysRecord) {
        return sysRecordMapper.insertSysRecord(sysRecord);
    }

    /**
     * 修改【请填写功能名称】
     *
     * @param sysRecord 【请填写功能名称】
     * @return 结果
     */
    @Override
    public int updateSysRecord(SysRecord sysRecord) {
        return sysRecordMapper.updateSysRecord(sysRecord);
    }

    /**
     * 批量删除【请填写功能名称】
     *
     * @param mobileUserIds 需要删除的【请填写功能名称】ID
     * @return 结果
     */
    @Override
    public int deleteSysRecordByIds(Long[] mobileUserIds) {
        return sysRecordMapper.deleteSysRecordByIds(mobileUserIds);
    }

    /**
     * 删除【请填写功能名称】信息
     *
     * @param mobileUserId 【请填写功能名称】ID
     * @return 结果
     */
    @Override
    public int deleteSysRecordById(Long mobileUserId) {
        return sysRecordMapper.deleteSysRecordById(mobileUserId);
    }

    @Override
    public List<SysRecord> selectSysRecordListMobileUser() {
        return sysRecordMapper.selectSysRecordListMobileUser();
    }
}
